package com.wht.media.controller;

import com.wht.media.model.param.VideoStackParam;
import com.wht.media.service.IVideoStackService;
import org.noear.solon.annotation.*;
import org.noear.solon.validation.annotation.NotBlank;
import org.noear.solon.validation.annotation.Validated;

/**
 * 拼接屏控制类
 * @author by HaiTao.Wang on 2025/9/12.
 */
@Controller
@Mapping("stack")
public class StackController {

    @Inject
    IVideoStackService iVideoStackService;

    /**
     * 开启拼接屏
     * @param param
     * @return
     */
    @Post
    @Mapping("start")
    public void startStack(@Validated @Body VideoStackParam param) {
        iVideoStackService.startStack(param);
    }

    /**
     * 重新设置拼接屏
     * @param param
     * @return
     */
    @Post
    @Mapping("reset")
    public void resetStack(@Validated @Body VideoStackParam param) {
        iVideoStackService.resetStack(param);
    }

    /**
     * 关闭拼接屏
     * @param id
     * @return
     */
    @Post
    @Mapping("stop")
    public void stopStack(@NotBlank(message = "拼接屏任务id不为空") @Param(value = "id") String id) {
        iVideoStackService.stopStack(id);
    }

}
